<template>
  <div class="knowledge-base-container">
    <div class="page-header">
      <h2>知识库构建</h2>
      <div class="header-actions">
        <button class="btn-primary">新建结构</button>
        <button class="btn-secondary">导入数据</button>
      </div>
    </div>
    
    <div class="kb-sections">
      <div class="section-card">
        <div class="section-icon">🏗️</div>
        <div class="section-content">
          <h3>知识库结构</h3>
          <p>管理知识库的层级结构和组织方式</p>
          <button class="btn-primary">进入管理</button>
        </div>
      </div>
      
      <div class="section-card">
        <div class="section-icon">📥</div>
        <div class="section-content">
          <h3>知识导入</h3>
          <p>批量导入知识内容，支持多种格式</p>
          <button class="btn-primary">开始导入</button>
        </div>
      </div>
      
      <div class="section-card">
        <div class="section-icon">📤</div>
        <div class="section-content">
          <h3>知识导出</h3>
          <p>导出知识库数据，支持多种格式</p>
          <button class="btn-primary">开始导出</button>
        </div>
      </div>
      
      <div class="section-card">
        <div class="section-icon">📄</div>
        <div class="section-content">
          <h3>知识模板</h3>
          <p>创建和管理知识内容模板</p>
          <button class="btn-primary">模板管理</button>
        </div>
      </div>
    </div>
    
    <div class="recent-activity">
      <h3>最近操作</h3>
      <div class="activity-list">
        <div class="activity-item">
          <span class="activity-icon">📥</span>
          <div class="activity-content">
            <p>导入了 50 条技术文档</p>
            <span class="activity-time">2小时前</span>
          </div>
        </div>
        <div class="activity-item">
          <span class="activity-icon">🏗️</span>
          <div class="activity-content">
            <p>更新了知识库结构</p>
            <span class="activity-time">1天前</span>
          </div>
        </div>
        <div class="activity-item">
          <span class="activity-icon">📄</span>
          <div class="activity-content">
            <p>创建了新的知识模板</p>
            <span class="activity-time">3天前</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 知识库构建组件逻辑
</script>

<style scoped>
.knowledge-base-container {
  padding: 0;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
}

.kb-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-card {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 0.5rem;
}

.section-content {
  flex: 1;
}

.section-content h3 {
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.section-content p {
  color: #6b7280;
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
}

.recent-activity {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.activity-icon {
  font-size: 1.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 0.375rem;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  color: #1f2937;
  font-size: 0.875rem;
  margin: 0 0 0.25rem 0;
}

.activity-time {
  color: #6b7280;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .kb-sections {
    grid-template-columns: 1fr;
  }
}
</style>
